<%@include file="/WEB-INF/common/taglibs.jsp" %>
<script src="/ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="/ckfinder/ckfinder.js"></script>

	
	
	<script>
	
		CKEDITOR.on( 'instanceReady', function( evt ) {
			var editor = evt.editor;
			
			// Apply focus class name.
			editor.on( 'focus', function() {
				editor.container.addClass( 'cke_focused' );
			});
			editor.on( 'blur', function() {
				editor.container.removeClass( 'cke_focused' );
			});

			// Put startup focus on the first editor in tab order.
			if ( editor.tabIndex == 1 ){
				editor.focus();
			}
			CKFinder.setupCKEditor( editor, { basePath : '/ckfinder/', skin : 'v1' } ) ;
			
		});

 
	</script>
<div class="row-fluid">
   <div class="span10">
     
    <form:form method="post" modelAttribute="template">
       <div class="title">
            <h4 class="clearfix">
               <span class="left">
							New / Edit Template
               </span>
               <span class="box-form right">
               		<button class="btn btn-success btn-mini" type="submit">Submit</button>
               </span>
            </h4>
         </div>
  		<input type="hidden" name="_method" value="${_method }" />
         <div class="form-horizontal clearfix">
         
	    	<div class="form-row  row-fluid">
               <label class="form-label span4">Title </label>
               <input class="span8" name="name" type="text" value="${template.name}" />
            </div>
            <div class="form-row  row-fluid">
               <label class="form-label span4">Title </label>
               <input class="span8" name="name" type="checkbox" value="${template.name}" />
            </div>
			<div class="form-row row-fluid">
             <label class="form-label span4">Template Full</label>
            <div class="span8 controls"><input type="checkbox" name="templateFull"  <c:if test="${template.templateFull}">  checked="checked" </c:if> 
			value="true" class="styled""></div>
			</div>
			
			<div class="form-row row-fluid">
             <label class="form-label span4">Search</label>
            <div class="span8 controls"><input type="checkbox" name="search"  <c:if test="${template.search}">  checked="checked" </c:if> 
			value="true" class="styled""></div>
			</div>
			
            </div>
		
			
            <div class="form-row span12 row-fluid">
              <textarea class="ckeditor" cols="80" id="editor4" rows="10" tabindex="1" name="content" >${template.content}</textarea>
              </div>
                 </form:form>
            </div>
         </div>
 